<%-- 
    Document   : cartcontent
    Created on : Sep 29, 2011, 10:49:53 AM
    Author     : phathuynh
--%>

<%@page import="hibernate.pojo.Sanpham"%>
<%@page import="org.hibernate.HibernateException"%>
<%@page import="java.text.DecimalFormat"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Zing Deal | Xem giỏ hàng Deal</title>
<link href="DealZing_files/6aad5646.css" rel="stylesheet" type="text/css" />
</head>
<body>
<%
    try
    {
        DecimalFormat df = new DecimalFormat("###,###");
        Sanpham sanpham = (Sanpham)request.getAttribute("SanPhamDatMua");
        if(sanpham!=null)
        {
%>    
    <div class="BoxDealHot">
        <div class="BoxDealHotTop">
            <form class="frmGiaoHang" name="DealBuyForm" id="DealBuyForm" method="post" action="cartcontroller?action=order&amp;paytype=1&amp;maSanPham=<%=sanpham.getMaSanPham()%>">
                <fieldset style="display:none;">
                    <input type="hidden" name="_method" value="POST" />
                    <input type="hidden" name="data[_Token][key]" value="ff3f905dd8bd7b0513cf941a0eb069b8e718c9fc" id="Token2023950007" />
                </fieldset>
                <div class="BoxDealHotBottom ViDeal">
                    <div class="Title"><h2 class="Num2">Đơn hàng của bạn</h2></div>
                    <div class="ViDealContent">
                        <table width="100%" cellpadding="0" cellspacing="1" class="MyTable table_ViDeal">
                            <thead>
                                <tr>
                                    <th>STT</th>
                                    <th class="HorzLeft">Thông tin chi tiết</th>
                                    <th>Số lượng</th>
                                    <th>Giá Mua</th>
                                    <th>Tổng số</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr class="OddRow OddRowViDeal" >
                                    <td class="HorzCenter  VeztTop">1</td>
                                    <td class=" VeztTop">
                                        <div style="position: relative; padding: 0; margin: 0;">
                                            <!-- Hiển thị tên sản phẩm vô giỏ hàng -->
                                            <a href="dealdetailcontroller?action=viewdealdetail&amp;maSanPham=<%=sanpham.getMaSanPham()%>" title="<%=sanpham.getTenSanPham()%>"><%=sanpham.getTenSanPham()%></a>
                                            <!-- Kết thúc hiển thị sản phẩm vô giỏ-->
                                        </div>
                                    </td>
                                    <td class="HorzCenter  VeztTop">                                        
                                        <fieldset>
                                            <div class="ContentSelect">
                                                <div class="GPFormSign">
                                                    <div class="GPFormItem">                                                            
                                                        <div class="input select required">
                                                            <!--<select name="soluong" class="js-quantity SelectUI Theme_GP Theme_GP_Modified" id="quantity">-->
                                                            <!--<select style="opacity: 0; position: absolute; left: -1000em; top: -1000em;" name="quantity" class="js-quantity SelectUI Theme_GP Theme_GP_Modified HasSelectUI" id="DealQuantity"> -->
                                                            <script language="javascript" src="DealZing_files/DecimalFormat.js"></script>
                                                            <script language="javascript">
                                                                function tinhTongTien()
                                                                {
                                                                    var soluong = document.DealBuyForm.quantity.value;
                                                                    var dongia = <%=sanpham.getGiaBan()%>;
                                                                    var tong = soluong*dongia;
                                                                    var df = new DecimalFormat("###,###");
                                                                    var t = df.format(tong);
                                                                    document.DealBuyForm.txtTongTien.value = t;
                                                                }
                                                            </script>
                                                            <select name="quantity" style="width: 50px" onchange="return tinhTongTien();">
                                                            <option value="1" selected="selected">1</option>
                                                            <option value="2">2</option>
                                                            <option value="3">3</option>
                                                            <option value="4">4</option>
                                                            <option value="5">5</option>
                                                            <option value="6">6</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </fieldset>
                                    </td>
                                    <td class="HorzCenter  VeztTop"><span class="c cr" title=""><%=df.format(sanpham.getGiaBan())%></span></td>
                                    <td class="HorzCenter  VeztTop"><span class="c cr" title=""><%=df.format(sanpham.getGiaBan())%></span></td>
                                </tr>
                                
                                <tr class="EvenRow" >
                                    <td colspan="5" class=" ">	                                        
                                        <div class="Sum" > Tổng giá: <span class="js-deal-total"> <span class="c cr" title=""><input onchange="" type="text" readonly="readonly" size="10" name="txtTongTien" value="<%=df.format(sanpham.getGiaBan())%>"/></span></span> <span class="d">đ </span></div> 
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <div class="HelpPay">
                            <h4> Hình thức thanh toán: </h4>	                                                            
                            <a href="http://deal.zing.vn/tp-ho-chi-minh/page/payment" class="Help" title="Câu hỏi thường gặp"> </a>	                                
                        </div>
                        <fieldset>
                                <ul class="TabOption">                                
                                    <li class="Active">                                        
                                        <div><label for="DealPaymentTypeIdTmp4"><a href="cartcontroller?action=payonline&amp;maSanPham=<%=sanpham.getMaSanPham()%>">Trực tuyến (Ví Zing Deal)</a></label></div>                                            
                                    </li>                                        
                                    <li>                                        
                                        <div>
                                          <label for="DealPaymentTypeIdTmp6"><a href="cartcontroller?action=delivery&amp;maSanPham=<%=sanpham.getMaSanPham()%>">Giao phiếu tận nơi</a></label>
                                        </div>                                            
                                    </li>                                        
                                </ul>                                                                                       
                            <div class="OrderPay JsZingXuMethod"> 	                                
                                <p>Ví ZingDeal là túi tiền dùng để thanh toán khi bạn mua hàng, để có tiền sử dụng trong túi, bạn có 2 cách nạp tiền vào trong túi: Nạp tiền bằng thẻ cào ZingCard và Nạp tiền bằng Thẻ ATM (Internet Banking)</p>
                                <div class="btn">
                                    <a href="atmcardcontroller?action=atmrecharge&amp;active=4" class="PayATM" style="margin-right:5px;background:url(DealZing_files/btn-napthe-atm.gif) no-repeat;">Nạp thẻ ATM</a>
                                    <a href="zingcardcontroller?action=zingcardrecharge&amp;active=4" class="PayZingCard" style="background:url(DealZing_files/btn-napthe-zingcard2.png) no-repeat;">Nạp thẻ Zing</a>
                                </div>
                            </div> 	                                                        
                            <div class="OrderPay OrderPay7b JsCODMethod" style="display:none;"></div> 								
                                <input type="hidden" value="3891" id="max-value-buy" />
                                <input type="hidden" value="0" name="min_limit_value_buy_4" />
                                <input type="hidden" value="0" name="min_limit_value_buy_6" />
                                <input type="hidden" name="data[Deal][buy_max_quantity_ply]" value="1" id="max-value-ply" />
                                <input type="hidden" name="data[Deal][user_available_balance]" value="" id="DealUserAvailableBalance" />
                                <input type="hidden" name="data[Deal][deal_id]" value="698" id="DealDealId" />
                                <input type="hidden" name="data[Deal][user_id]" value="995271" id="DealUserId" />
                                <input type="hidden" name="data[Deal][is_gift]" value="0" id="DealIsGift" />
                                <input type="hidden" name="data[Deal][deal_amount]" value="89000.00" id="DealDealAmount" />                                
                                <div class="ViDealGif"> <a href="cartcontroller?action=present&amp;maSanPham=<%=sanpham.getMaSanPham()%>" class="MuaTang" title="Tặng phiếu Zing Deal này cho bạn bè">Tặng phiếu Zing Deal này cho bạn bè</a></div> 
                                <input type="submit" value="Hoàn tất đơn hàng" title="Hoàn tất đơn hàng" class="SubmitBtn" style="background:url(DealZing_files/btn-hoan.gif) no-repeat;" />                            
                        </fieldset>
                    </div>
                </div>
            </form>
        </div>			
    </div>
<%
        }
    }
    catch(HibernateException ex)
    {
        out.print(ex);
    }
%>
</body>
</html>
